from pymongo import MongoClient

conn = MongoClient('192.168.0.113', 27017)
db=conn.studyurl
dbset=db.mp4url

data=[]
with open('mp4url.txt','r',encoding='utf-8') as f:
    count=0
    for line in f:
        count=count+1
        temp={}
        temp['url']=line.replace('\n','')
        temp['num']=str(count)
        data.append(temp)
    temp={}
    temp['url']='numcount'
    temp['num']=str(count)
    data.append(temp)
    
dbset.insert(data)



conn.close()